package com.hbm.usercenter.holder;

import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.hbm.usercenter.R;
import com.hbm.usercenter.base.BaseHolder;
import com.hbm.usercenter.bean.GroupOrderBean;
import com.hbm.usercenter.utils.CommonUtils;
import com.hbm.usercenter.utils.LogUtils;
import com.hbm.usercenter.utils.UIUtils;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by BS on 2017/6/22.
 */

public class GroupOrderHolder extends BaseHolder<GroupOrderBean.MyCheckBean> {
    @Bind(R.id.tv_grade)
    TextView mTvGrade;
    @Bind(R.id.tv_price)
    TextView mTvPrice;
    @Bind(R.id.tv_date)
    TextView mTvDate;
    @Bind(R.id.tv_status)
    TextView mTvStatus;
    @Bind(R.id.tv_cancel)
    Button mTvCancel;
    @Bind(R.id.tv_pay)
    Button mTvPay;

    @Override
    protected View initHolderView() {
        View view = View.inflate(UIUtils.getContext(), R.layout.item_grouporder, null);
        ButterKnife.bind(this, view);
        return view;
    }

    @Override
    protected void refreshHolderView(GroupOrderBean.MyCheckBean data) {
        mTvGrade.setText("升级为"+data.grade+"级");
        mTvPrice.setText("￥"+data.total_price);
        LogUtils.s(data.create_time+"-------------a a 啊啊时间");
        mTvDate.setText(CommonUtils.timestampToString(Integer.parseInt(data.create_time)));
//        data.pay_status;
    }

    @OnClick({R.id.tv_cancel, R.id.tv_pay})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_cancel:
                break;
            case R.id.tv_pay:
                break;
        }
    }
}
